package com.platform.api.bzproject.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.platform.api.bzproject.dao.BzBannerMapper;
import com.platform.api.bzproject.model.BzBanner;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author guoyunfei on 2021/7/9 14:03
 * @className BzBannerMapper
 * @description TODO
 * @Version 1.0
 */

@Service
@Transactional(rollbackFor=Exception.class)
public class BzBannerService extends ServiceImpl<BzBannerMapper, BzBanner> {

    @Autowired
    private BzBannerMapper bzBannerDao;

    public List<BzBanner> bannerList(BzBanner bzBanner){
        List<BzBanner> bzBannerList = bzBannerDao.selectList(new LambdaQueryWrapper<BzBanner>()
                .eq(null != bzBanner.getEnable() , BzBanner::getEnable,bzBanner.getEnable())
                .eq(null != bzBanner.getAppid(), BzBanner::getAppid,bzBanner.getAppid()));
        return bzBannerList;
    }

}
